package com.erdos.core.dao.ibatis;

import java.util.List;
import java.util.Map;

import com.erdos.common.dao.IBatisGenericDaoImpl;
import com.erdos.core.dao.FSMDao;
import com.erdos.core.entity.Event;
import com.erdos.core.entity.State;

public class FSMDaoImpl extends IBatisGenericDaoImpl<Event> implements FSMDao{

	/* (non-Javadoc)
	 * @see com.hp.core.dao.FSMDao#findEventsByTransitionParams(java.util.Map)
	 */
	public List<Event> findEventsByTransitionParams(Map<String, Object> params) {
		List<Event> list = this.getSqlMapClientTemplate().queryForList("Event.findEventsByTransitionParams",params);
		return list;
	}

	/* (non-Javadoc)
	 * @see com.hp.core.dao.FSMDao#findStatesByTransitionParams(java.util.Map)
	 */
	public List<State> findStatesByTransitionParams(Map<String, Object> params) {
		List<State> list = this.getSqlMapClientTemplate().queryForList("State.findStatesByTransitionParams",params);
		return list;
	}

	/* (non-Javadoc)
	 * @see com.hp.core.dao.FSMDao#insertStateTransitionHistory(java.util.Map)
	 */
	public void insertStateTransitionHistory(Map<String, Object> params) {
		this.getSqlMapClientTemplate().insert("StateTransition.insertHistory", params);
	}

}
